package com.hyg.lib_common.customView;

import android.app.Activity;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.hyg.lib_common.R;

/**
 * @author: Administrator
 * @date: 2021/3/5
 */
public class TitleView extends RelativeLayout {
    ImageView backImage;
    TextView titleTv;

    public TitleView(Context context) {
        super(context);
    }

    public TitleView(Activity context, String title) {
        super(context);
        LayoutInflater inflater=(LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        inflater.inflate(R.layout.ln_title_view,this);
        backImage=(ImageView) findViewById(R.id.back);
        titleTv=(TextView)findViewById(R.id.tv_title);
        backImage.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                context.finish();
            }
        });
        titleTv.setText(title);
    }

}
